<template>
  <div class="visualBlock">
    <icon name="arrow-left" class="backIcon" @click="$router.history.go(-1)"/>
    <div class="flex">
      <img src="~static/images/done.png" alt="" v-if="form.type == '1'">
      <img src="~static/images/fail.png" alt="" v-if="form.type == '2'">
      <div class="form">
        <div class="len"><div class="key">身份证：</div>{{form.cardId}}</div>
        <div class="len"><div class="key">姓&nbsp;&nbsp;名：</div>{{form.name}}</div>
        <div class="len"><div class="key">认证项目：</div>{{form.rzxm}}</div>
        <div class="len"><div class="key">认证时间：</div>{{form.rzrq}}</div>
        <div class="len"><div class="key">认证结果：</div>{{form.type == '1' ? '通过' : '未通过'}}</div>
        <div class="len" style="font-size: 14px;">{{$store.state.currentUser.tip}}</div>
      </div>
    </div>
  </div>
</template>

<script>
  import { Icon } from 'vant';
  export default {
    components: {Icon},
    data () {
      return {
        form: {
          type: 1
        }
      };
    },
    mounted: function () {
      if (!this.$store.state.isLogin) {
        this.$router.replace({path: '/login', query: {from: 'process'}});
      } else {
        var user = this.$store.state.currentUser;
        this.form = user.jqrz;
      }
    }
  };
</script>

<style lang="less" scoped>
.visualBlock {
  .backIcon {
    position: absolute;
    width: 30px;
    height: 30px;
    color: #fff;
    font-size: 24px;
    top: 10px;
    left: 10px;
    background: #e9bdbd96;
    border-radius: 50%;
    line-height: 30px;
  }
  position: fixed;
  top: 0;
  z-index: 100;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
}
.flex {
  margin-top: 40px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-direction: column;
  img {
    width: 50%;
  }
  .form {
    .len {
      display: flex;
      font-size: 15px;
      line-height: 34px;
      .key {
        width: 90px;
      }
    }
  }
}

.visualBlock .backIcon {
  background: #e9bdbd;
}
</style>